n=int (input("n= "))
s=0
t=1
for i in range (1,n+1):
    t+=i
    s+=t
print("前{}阶乘的和是：{}" .format(n,s))
